/*
 * Clock.cpp
 *
 *  Created on: 2012-5-18
 *      Author: WuyaMony
 */

#include "Clock.h"

namespace my {

Clock::Clock(deque<int> &Data, Adder &adder) :
		_data(Data), _adder(adder), _timeCost(0) {
}

void Clock::Tick() {
	_timeCost++;
	if (_data.size() < 2) {
		return;
	}
	int a=_data.front();_data.pop_front();
	int b=_data.front();_data.pop_front();
	_adder.addTask(a, b);
}
} /* namespace my */
